<?php

namespace app\admin\model\procure;

use think\Model;

/**
 * Purchdata
 */
class Purchdata extends Model
{
    // 表主键
    protected $pk = 'supplierno';
    
    // 表名
    protected $name = 'procure_purchdata';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function suppliernoTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\procure\Suppliers::class, 'supplierno', 'supplierid');
    }

    public function stockidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Stockmaster::class, 'stockid', 'stockid');
    }

    public function suppliersuomTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Unitsofmeasure::class, 'suppliersuom', 'unitname');
    }
}